{include file='seo/header.html'}
<span class="td4"> 
    <div class="botline"></div>
    <div class="filtrs"> Фильтр 
        <form method="post" action="{geturl action='tenders'}" id="filter-form">

            <select name='cats_filter[]' id='cats_filter' data-placeholder="Выбрать категорию" class="chosen-select_cat" multiple style="width:150px;" tabindex="4">
                <option value="0" ></option>
                {foreach from=$cats item=cat}
                {if in_array($cat->getId(),$cats_filter)}
                <option value="{$cat->getId()}" selected='selected'>{$cat->name}</option>
                {else}
                <option value="{$cat->getId()}">{$cat->name}</option>
                {/if}
                {/foreach}
            </select>

            <select name='projects_filter[]' id='projects_filter' data-placeholder="Выбрать проект" class="chosen-select_project" multiple style="width:150px;" tabindex="4">
                <option value='0'></option>
                {foreach from=$projects item=project}
                {if in_array($project->getId(), $projects_filter)}
                <option value="{$project->getId()}" selected='selected'>{$project->name}</option>
                {else}
                <option value="{$project->getId()}">{$project->name}</option>
                {/if}
                {/foreach}
            </select>

            <select name='archive_filter' id='projects_filter' data-placeholder="Показывать все" class="chosen-select_project" style="width:150px;" tabindex="4">
                {if $archive_filter == ''}
                <option value="2" selected='selected'>Все</option>
                {else}
                <option value="2">Все</option>
                {/if}

                {if $archive_filter == 0}
                <option value="0" selected='selected'>Активные</option>
                {else}
                <option value="0">Активные</option>
                {/if}

                {if $archive_filter == 1}
                <option value="1" selected='selected'>Не активные</option>
                {else}
                <option value="1">Не активные</option>
                {/if}

            </select>   

            <button type="submit" class="send">Фильтр</button>

        </form>
        <br>   
        Поиск<form method="post" action="{geturl action='tenders'}" id="filter-form" style="margin-left:63px;">

            <input type="text" id="form_search" name="search" value="Поиск" onfocus="if (this.value == 'Поиск')
                              this.value = ''" onblur="if (this.value == '') {
                              ldelim
                          }
                          this.value = 'Поиск'{
                              rdelim
                          }" style="width:455px"/>

            <button type="submit" class="send" >Поиск</button>
        </form>
        <!-- <br>
      
         {if $sort=='name'}
         <a href="?sort=name&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Имя</a>
         {else}
         <a href="?sort=name&order={if $order=='desc'}asc{else}desc{/if}">Имя</a>
         {/if}
   
         {if $sort=='start_date'}
         <a href="?sort=start_date&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Дата добавления</a>
         {else}
         <a href="?sort=start_date&order={if $order=='desc'}asc{else}desc{/if}">Дата добавления</a>
         {/if}
   
          {if $sort=='end_date'}
         <a href="?sort=end_date&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Дата окончания</a>
         {else}
         <a href="?sort=end_date&order={if $order=='desc'}asc{else}desc{/if}">Дата окончания</a>
         {/if}
         
         {if $sort=='archive'}
         <a href="?sort=archive&order={if $order=='desc'}asc{else}desc{/if}" class="{$order}">Архив</a>
         {else}
         <a href="?sort=archive&order={if $order=='desc'}asc{else}desc{/if}">Архив</a>
         {/if}-->

    </div>
<table width='100%'>
{foreach from=$tenders item=tender}
<tr id="tr_{$tender->getId()}">
            <td class="nocontainer fs12" id="name_{$tender->getId()}">
                <a href="{geturl route='seoedittender' id=$tender->getId()}" id="name_{$tender->getId()}"> {$tender->name}</a>
                <div class="botline mgbottd"></div>
            </td>
        </tr>
{/foreach}
</table>
    {if $pages != 1}
    <div class="pages">
        {section loop=$pages name=page}
        {assign var=p value=$smarty.section.page.index_next}
        {if $p == $page}
        <span>{$p}</span>
        {else}
        {if $p==1}
        <a href="{geturl route='metatenders'}">{$p}</a>
        {else}
        <a href="{geturl route='metatenders'}?p={$p}">{$p}</a>
        {/if}


        {/if}
        {/section}
    </div>
    {/if}
</span>
{literal}
<script>
                      $(document).ready(function() {
                          // $("#alertify-text").live('focus', function(){alert();$(this).datepicker({dateFormat: "yy-mm-dd"});});
                      });
</script>
{/literal}
{include file='seo/footer.html' menu='metatenders'}